import torch
from PIL import Image
import torchvision.transforms as T
import hubconf

dinov2_vits14 = hubconf.dinov2_vits14()

img = Image.open('models/FOUND/data/examples/VOC_000030.jpg')

transform = T.Compose([
T.Resize(224),
T.CenterCrop(224),
T.ToTensor(),
T.Normalize(mean=[0.5], std=[0.5]),
])

img = transform(img)[:3].unsqueeze(0)

with torch.no_grad():
    features = dinov2_vits14(img, return_patches=True)[0]

print(features.shape)